#include "Lockable.h"

/*
	Lockable
*/

/*	public	*/

Lockable::Lockable()
	//: mutex(QMutex::NonRecursive),
	: mutex(QMutex::Recursive),
	locked(false) {}

void Lockable::lock() const {
//	qDebug(">>> Lockable::lock()");
	mutex.lock();
	locked = true;
//	qDebug("<<< Lockable::lock()");
}

void Lockable::unlock() const {
//	qDebug(">>> Lockable::unlock()");
	locked = false;
	mutex.unlock();
//	qDebug("<<< Lockable::unlock()");
}

bool Lockable::isLocked() const {
	return locked;
}


